<?php

/**
 * Task form base class.
 *
 * @package    FinalsClub
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseTaskForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'task_list_id'   => new sfWidgetFormPropelChoice(array('model' => 'TaskList', 'add_empty' => false)),
      'creator_id'     => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'user_id'        => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'group_id'       => new sfWidgetFormPropelChoice(array('model' => 'Group', 'add_empty' => true)),
      'course_id'      => new sfWidgetFormPropelChoice(array('model' => 'Course', 'add_empty' => true)),
      'type_id'        => new sfWidgetFormInput(),
      'type'           => new sfWidgetFormInput(),
      'resource_id'    => new sfWidgetFormInput(),
      'resource'       => new sfWidgetFormInput(),
      'name'           => new sfWidgetFormInput(),
      'description'    => new sfWidgetFormTextarea(),
      'url'            => new sfWidgetFormInput(),
      'url_title'      => new sfWidgetFormInput(),
      'lecture_number' => new sfWidgetFormInput(),
      'due_date'       => new sfWidgetFormDate(),
      'status'         => new sfWidgetFormInput(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'Task', 'column' => 'id', 'required' => false)),
      'task_list_id'   => new sfValidatorPropelChoice(array('model' => 'TaskList', 'column' => 'id')),
      'creator_id'     => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id')),
      'user_id'        => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id')),
      'group_id'       => new sfValidatorPropelChoice(array('model' => 'Group', 'column' => 'id', 'required' => false)),
      'course_id'      => new sfValidatorPropelChoice(array('model' => 'Course', 'column' => 'id', 'required' => false)),
      'type_id'        => new sfValidatorInteger(array('required' => false)),
      'type'           => new sfValidatorString(array('max_length' => 40, 'required' => false)),
      'resource_id'    => new sfValidatorInteger(array('required' => false)),
      'resource'       => new sfValidatorString(array('max_length' => 40, 'required' => false)),
      'name'           => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'description'    => new sfValidatorString(array('required' => false)),
      'url'            => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'url_title'      => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'lecture_number' => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'due_date'       => new sfValidatorDate(array('required' => false)),
      'status'         => new sfValidatorInteger(array('required' => false)),
      'created_at'     => new sfValidatorDateTime(array('required' => false)),
      'updated_at'     => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('task[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Task';
  }


}
